﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
	<meta content="telephone=no" name="format-detection" />
	<meta http-equiv="Cache-Control" content="no-transform " />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="applicable-device" content="mobile" />
	<title>个人中心</title>
	<meta name="Keywords" content="" />
	<meta name="Description" content="" />
	<link rel="stylesheet" type="text/css" href="/Public/home/css/ranking_1.css" />
	<link rel="stylesheet" type="text/css" href="/Public/home/css/recharge_7.css" />
	<script>
		var t_text = "最全小说";
		var url_channel = "";
		if(url_channel != '') {
			try {
				var state = {
					title: t_text,
					url: url_channel
				};
				history.replaceState(state, t_text, url_channel);
			} catch(e) {}
		}
	</script>
	<script type="text/javascript" src="/Public/home/js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="/Public/home/js/public.js"></script>
	<script type="text/javascript" src="/Public/home/js/pay.js"></script>
	<style>
		body {
			-webkit-touch-callout: none;
			-webkit-user-select: none;
			-khtml-user-select: none;
			-moz-user-select: none;
			-ms-user-select: none;
			user-select: none;
		}
		.footer{width: 100%;position: fixed;left: 0;right: 0;bottom: 0;background: #fff;border-top: 1px solid #ddd;display: table;z-index: 9;}
		.footer ul{display: table-row;}
		.footer li{display: table-cell;text-align: center;}
		.footer li a{height: 49px;line-height: 49px;display: block;font-size: 1.5rem;color: #a0a0a0;font-family: "Microsoft Yahei", sans-serif}
		.footer li a.active{color: #ff730b;}
		.footer li a i{width: 17px;height: 17px;display: inline-block;background: url(/Public/home/images/column.png) no-repeat;background-size: 115px 17px;position: relative;top: 4px;margin-right: 6px;}
		.footer li a i.icon-book{background-position: 0 0;}
		.footer li a.active i.icon-book{background-position: -20px 0;}
		.footer li a i.icon-choice{background-position: -42px 0;}
		.footer li a.active i.icon-choice{background-position: -61px 0;}
		.footer li a i.icon-my{background-position: -80px 0;}
		.footer li a.active i.icon-my{background-position: -98px 0;}


		.hongbao{
			width: 120px;
			height:40px;
			position: absolute;
			right: 2%;
			bottom: -15%;
			animation: hongbaos .6s ease-in-out infinite;
		}
		@keyframes hongbaos {
			0%,100%{
				transform: skewY(0deg);
			}
			50%{
				transform: skewY(3deg);
			}
		}
		.icon-recharge-1{
			width:21px;
			height:21px;
			background:url("../../Public/home/images/ranktops1.png") no-repeat center center;
			background-size:100%;
			float:left;
			margin-top:14px;
			margin-right:6px;
		}
		.icon-money1{
			width:21px;
			height:21px;
			background:url("../../Public/home/images/icon-money1.png") no-repeat center center;
			float:left;
			background-size:100%;
			margin-top:14px;
			margin-right:6px;
		}
		.icon-woman1{
			width:21px;
			height:21px;
			background:url("../../Public/home/images/icon-woman1.png") no-repeat center center;
			background-size:100%;
			float:left;
			margin-top:14px;
			margin-right:6px;
		}
	</style>
</head>

<body style="position: relative">
<if condition="$is_show == 1"><div class="hongbao"><a href="{:U('paymoney')}"><img width="100%" height="100%" src="/Public/home/img/hongbao.png"></a></div></if>
<div class="wrapper">
	<!--头部 begin-->
	<div class="uf-header mt-44 clearfix"><img src="/Public/home/images/uf-bg.jpg" class="bg">
		<div class="center">
			<div class="user">
				<div class="avatar" href="javascript:;"><img src="{$user.img}"></div>
				<div style="line-height: 20px;font-size: 15px;margin-top: 13px;">{$user.nickname}</div>
				<?php if($user['is_vip'] == 1):?>
				<img src="/Public/home/other/vip.png" style="position: absolute;width: 15px;top: 49px;left: 54%;" alt="111">
				<?php endif;?>

				<div style="line-height: 30px;font-size: 15px;">ID: &nbsp; {$user.user_id}</div>

			</div>
		</div>
	</div>
	<!--头部 end-->
	<!--列表 begin-->
	<div class="uf-box mb-156 clearfix">
		<div class="item">
			<a href="javascript:;" class="has-arrow"><!--<i class="icon-money"></i>--> <div class="icon-money1"></div>我的余额
				<div class="pull-right"><span class="typo-orange">{$user.book_money}书币</span></div>
			</a>
		</div>
		<div class="item  mb-10">
			<?php if($user['is_vip']==1):?>
			<a href="javascript:;" onclick="show_login1();" class="has-arrow"><i class="icon-vip"></i>会员特权
				<div class="pull-right"><span class="typo-orange">{$user['vip_end_date']}</span></div>
			</a>
			<?php else:?>
			<!--<a href="javascript:;" onclick="show_login();" class="has-arrow"><i class="icon-vip"></i>开通VIP-->
				<!--<div class="pull-right"><span class="typo-orange">看书更省钱</span></div>-->
			<!--</a>-->
			<?php endif;?>
		</div>
		<!--<div class="item">-->
			<!--<a href="/Home/User/recharge" class="has-arrow red-text">&lt;!&ndash;<i class="icon-recharge"></i>&ndash;&gt;<div class="icon-recharge-1"></div>书币充值-->
				<!--<div class="pull-right"><span class="typo-orange">送书币</span><i class="reddot"></i></div>-->
			<!--</a>-->
		<!--</div>-->
		<!--<div class="item">-->
		<!--<a href="/my/recharge" class="has-arrow"><i class="icon-money-time"></i>消费记录 </a>-->
		<!--</div>-->
		<!--<div class="item mb-10">
            <a href="{:U('book_buy')}" class="has-arrow"><i class="icon-book"></i>购买的书 </a>
        </div>-->

		<div class="item">
			<a href="/Home/User/phoneAuth" class="has-arrow"><!--<i class="icon-woman"></i>--><div class="icon-phone"></div> 手机认证
				<div class="pull-right"><span class="typo-orange"></span></div>
			</a>
		</div>
		<div class="item">
			<a href="/Home/User/help" class="has-arrow"><!--<i class="icon-woman"></i>--><div class="icon-woman1"></div> 联系客服
				<div class="pull-right"><span class="typo-orange"></span></div>
			</a>
		</div>


		<!--<div class="item">
            <a href="javascript:;" onclick="show_login();" class="ne"><i class="icon-cart"></i>自动购买付费章节</a>
            <div class="pull-right">
                <a href="javascript:;" onclick="show_login();" class="rw">
                    <div class="box">
                        <div class="circle"></div>
                    </div><input type="radio" name="autoPay" value="1" checked="" id="autoPay"></a>
            </div>
        </div>-->
		<!--<div class="item">
            <a href="help.html" class="has-arrow"><i class="icon-woman"></i>客服帮助 </a>
        </div>-->
	</div>
	<!--排行榜 end-->
</div>
<script>
	$(function() {
		var fontSize = $(window).width() / 25;
		$("html").css("font-size", fontSize);
		uid = "0";
	})
</script>
<!--login begin-->
<div class="backdrop bh_wxlogin_lay" style="display: none;"></div>
<div class="modal bh_wxlogin_lay" style="margin-top: -114px; display: none;">
	<div class="inner clearfix">
		<div class="wechat-login-box">
			<div class="head">
				<div class="title" style="font-weight: 100;">开通VIP！</div>
			</div>
			<div class="body mt-12 clearfix" style="font-size: 15px;margin-top: 20px;">
				<span style="color: red;">加V</span>标识 , 独享尊贵身份!
			</div>
			<div class="body mt-10 clearfix" style="font-size: 15px;">
				每天只要1元钱,畅读所有vip小说!
			</div>
		</div>
		<hr/>
		<div style="font-size:16px;color: red;text-align: center;padding-bottom: 20px;">直接开通会员(365元/年)</div>
		<div class="bottom" style="height: 60px;background-color: #fff;background-image: none;">
			<a href="{$pay_path}?id=6&open_id={$open_id}&back_domain={$back_domain}" >
				<div style="width: 80%; height:40px;color:white;background-color:#45a8eb;line-height: 40px;margin: auto;border-radius: 5px">直接开通</div>
			</a>
		</div>
		<div class="pull-action">
			<a onclick="hide_login();"><i class="icon-close"></i></a>
		</div>
	</div>
</div>
<!--login end-->

<!--login1 begin-->
<div class="backdrop bh_wxlogin_lay1" style="display: none;"></div>
<div class="modal bh_wxlogin_lay1" style="margin-top: -114px; display: none;">
	<div class="inner clearfix">
		<div class="wechat-login-box">
			<div class="head">
				<div class="title" style="font-weight: 100;">VIP到期时间</div>
			</div>
			<div class="body mt-12 clearfix" style="font-size: 15px;margin-top: 20px;">
				{$user['vip_end_date']} 到期
			</div>
		</div>
		<div class="bottom" style="height: 60px;background-color: #fff;background-image: none;">
			<a onclick="hide_login1();" >
				<div style="width: 80%; height:40px;color:white;background-color:#45a8eb;line-height: 40px;margin: auto;border-radius: 5px">我知道了</div>
			</a>
		</div>
		<div class="pull-action">
			<a onclick="hide_login1();"><i class="icon-close"></i></a>
		</div>
	</div>
</div>
<!--login1 end-->
<!-- 选择充值书币数额面板 -->
<div class="backdrop bh_recharge_box" style="display: none;"></div>
<div class="item2p recharge_sc bh_recharge_box" style="display: none;">
	<div class="inner">
		<div class="title"><strong>请选择充值金额</strong>
			<p class="read">首充翻倍送书币</p>
		</div>
		<div class="close">
			<a href="javascript:;" onclick="hide_recharge_box();"></a>
		</div>
		<div class="entry">
			<ul>
				<li>
					<a onclick="switchCoins(this,3)" data-pid="3"  class="active"><i class="chong-icon-check"></i><span class="jine">50元</span><i class="cz-xian"></i>
						<div class="rt"><span class="tip">5000书币+3000书币</span><i class="reward">(多送30元)</i></div>
					</a>
				</li>
				<li>
					<a onclick="switchCoins(this,4)" data-pid="4"><span class="jine">30元</span><i class="cz-xian"></i>
						<div class="rt" style="line-height: 45px;"><span class="tip">3000书币</span><i class="reward">(多送0元)</i></div>
					</a>
				</li>
				<li>
					<a onclick="switchCoins(this,2) " data-pid="2"><i class="chong-icon-check"></i><span class="jine">100元</span><i class="cz-xian"></i>
						<div class="rt"><span class="tip">10000书币+8000书币</span><i class="reward">(多送80元)</i></div>
					</a>
				</li>
				<li>
					<a onclick="switchCoins(this,1)" data-pid="4" class=""><i class="chong-icon-check"></i><span class="jine">200元</span><i class="cz-xian"></i>
						<div class="rt"><span class="tip">20000书币+20000书币</span><i class="reward">(多送200元)</i></div>
					</a>
				</li>
			</ul>
		</div>
		<div class="btn">
			<a href="javascript:;" onclick="choice_pay();">立即充值</a>
		</div>
	</div><input type="hidden" value="50" id="coinmoney"></div>
<!-- 选择充值书币数额面板 -->
<!-- 支付浮层 -->
<div class="backdrop choice_pay_box" style="display: none;"></div>
<div class="item2p choice-pay choice_pay_box" style="display: none;">
	<div class="inner">
		<div class="title"><strong>选择支付方式</strong></div>
		<div class="close">
			<a href="javascript:;" onclick="hide_choice_pay();"></a>
		</div>
		<div class="entry">
			<ul>
				<!--<li><a href="#"><i class="icon-ios"></i>苹果支付</a></li>-->
				<li id="now_wx">
					<a href="javascript:;" onclick="apiPay_now_fun(2);"><i class="icon-wechat"></i>微信支付</a>
				</li>
				<li>
					<a href="javascript:;" onclick="apiPay_zfb_fun(2);"><i class="icon-alipay"></i>支付宝支付</a>
				</li>
			</ul>
		</div>
	</div>
</div>
<!--支付浮层 -->
<script>
	// 支付宝支付
	var paynow_url = "/nowpay/pay";
	var articleId = null;
	var returnUrl = '';
	var tradeType = '';
	var submitting = false;
	var open_id = "{$open_id}";

	/*function switchCoins(id) {
	 if (submitting) {
	 return false;
	 }

	 submitting = true;
	 var productId = $('#products-grid .product-item.active').attr('data-pid');
	 var url = "{$pay_path}";
	 var url = url+ '?id=' + id + "&open_id=" + open_id;
	 if (articleId) {
	 url += '&aid=' + articleId;
	 }
	 if (tradeType) {
	 url += '&trade_type=' + tradeType;
	 }
	 if (returnUrl) {
	 url += '&return=' + encodeURIComponent(returnUrl);
	 }

	 location.href = url;
	 }*/

	function choice_pay() {
		if (submitting) {
			return false;
		}

		submitting = true;
		var productId = $('ul li a.active').attr('data-pid');
		var url = "{$pay_path}";
		var url = url+ '?id=' + productId + "&open_id=" + open_id;
		if (articleId) {
			url += '&aid=' + articleId;
		}
		if (tradeType) {
			url += '&trade_type=' + tradeType;
		}
		if (returnUrl) {
			url += '&return=' + encodeURIComponent(returnUrl);
		}

		location.href = url;

	}

	function apiPay_now_fun(pro_id) {
		// pro_id  1购买VIP  2购买书币  3打赏
		if(pro_id == 1) {
			paytitle = '购买VIP';
			payfee = 28;
		}
		if(pro_id == 2) {
			paytitle = '购买书币';
			payfee = $("#coinmoney").val();
		}
		if(pro_id == 3) {
			paytitle = '打赏';
			payfee = $("#dasmoney").val();
		}
		payfee = parseFloat(payfee) + 0;
		if(payfee < 0.01 || isNaN(payfee)) {
			bh_msg_tips(paytitle + '金额不能小于0.01元');
			return false;
		}
		checkandnowpay(payfee, pro_id, paytitle, bid, encodeURI(window.location.href));
	}
</script>
<div class="footer"  id="footer_nav">
	<ul>
		<li>
			<a href="/Home/Shelf/index"><i class="icon-book"></i>书架</a>
		</li>
		<li>
			<a href="/Home/Index/index" class="active"><i class="icon-choice"></i>首页</a>
		</li>
		<li>
			<a href="/Home/User/userinfo"><i class="icon-my"></i>我的</a>
		</li>
	</ul>
</div>
<script>
	$(function() {
		$('#footer_nav li a').removeClass('active');
		$('#footer_nav li').eq(2).find("a").addClass('active');
	})
</script>
<script>
	var _hmt = _hmt || [];
	(function() {
		var hm = document.createElement("script");
		hm.src = "https://hm.baidu.com/hm.js?fcd37298453821c3bc8b266221db88ac";
		var s = document.getElementsByTagName("script")[0];
		s.parentNode.insertBefore(hm, s);
	})();
</script>
<script>
	/*防止iframe劫持*/
	if(self.frameElement && self.frameElement.tagName == "IFRAME") {
		top.location.href = self.location.href;
	}
	if(window.frames.length != parent.frames.length) {
		top.location.href = self.location.href;
	}
	if(self != top) {
		top.location.href = self.location.href;
	}
	var cookie_channel = "";
	var cookie_user = "1506047456286";
	var pv_uid = "0";
	var noadduv = "0";
	if(parseInt(noadduv) > 0) {
		cookie_user = 0;
	}

	if(parseInt(cookie_channel) * 1 > 0) {
		tj_pv_uvhost(pv_uid, cookie_channel, cookie_user);
	}

	// 记录pv 和uv
	function tj_pv_uvhost(uid, channel, user) {
		var tj_pv_uv_url = "//uv.qirexiaoshuo.com/Index/record_pvuv";
		var tj_pv_uv_data = {
			uid: uid,
			channel: channel,
			user: user
		};
		AjaxJsonP(tj_pv_uv_url, tj_pv_uv_data)
	}
</script>
<style>
	#EG0phD8f {
		display: none !important;
	}
</style>
<script>
	var nowPayQuery = false;
	var payPackage = null;

	function show_login1() {
		$('.bh_wxlogin_lay1').show();
	}
	function hide_login1() {
		$('.bh_wxlogin_lay1').hide();
	}
	function checkandnowpay(fee, product_id, product_name, book_id, callback) {
		var report_url = '/nowpay/pay';
		var report_data = {
			fee: fee,
			product_id: product_id,
			product_name: product_name,
			bid: book_id,
			callback: callback,
			random: Math.floor(Math.random() * 10000 + 1)
		};
		AjaxJson(report_url, report_data, function(res) {
			if(res.status * 1 == 1) {
				payPackage = res.data;
				nowPayQuery = true;
				window.location.href = payPackage.weixin_url;
				//不知道他们的同步回调（前台回调）是怎么回事
			} else if(res.status * 1 == -1) {
				//需要登录
				bh_msg_tips("需要登录，请重新登录重试");
				show_login();
			} else if(res.status * 1 == -2) {
				//输入参数有问题
				bh_msg_tips("选择的充值信息有误，请重新选择重试");
			} else if(res.status * 1 == -11) {
				//输入参数有问题
				bh_msg_tips("下单失败，请稍后重试");
			} else {
				bh_msg_tips(res.msg);
			}
		});
	}

	function pageFocusQueryNowPay() {
		//查询是否支付成功，成功则提示成功，然后刷新页面
		if(nowPayQuery) {
			AjaxJson('/nowpay/ajax_query', payPackage, function(res) {
				hide_choice_pay();
				if(res.status * 1 == 1) {
					bh_msg_tips("支付成功");
					setTimeout(function() {
						window.location.reload();
					}, 500);
					return;
				} else {
					//                    bh_msg_tips("未支付成功");
					return;
				}
			});
		}
	}

	$(function() {
		setInterval(function() {
			pageFocusQueryNowPay();
		}, 2000);
	})
</script>
</body>

</html>